package com.itheima.api.client;

import com.itheima.api.client.dto.WebUser;
import com.itheima.api.client.fallback.UserClientFallbackFactory;
import com.itheima.api.client.vo.BlogContributionVO;
import com.itheima.api.client.vo.ProvinceBLogNum;
import com.itheima.api.client.vo.TBlogByCategoryID;
import com.itheima.api.client.vo.TBlogByTagID;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;


import java.util.List;

@FeignClient(value = "blog-web",
        contextId = "bolgWeb2",
        configuration = FeignClientConfig.class,
        fallbackFactory = UserClientFallbackFactory.class)
public interface UserDemoClient {
    @GetMapping("/web/owner/blogs")
    public Long getBlogs();

    @GetMapping("/web/owner/comments")
    public Long getComments();

    @PostMapping("/web/owner/tag/blogs")
    public  List<TBlogByTagID> getTBlogByTagID();
    @PostMapping("/web/owner/category/blogs")
    public List<TBlogByCategoryID> getTBlogByCategoryID();

    @PostMapping("/web/owner/contribute")
    public List<BlogContributionVO> getBlogContributions();

    @GetMapping("/web/owner/province/blogs")
    public  List<ProvinceBLogNum>  getProvinceBLogNum(@RequestParam("classify") Integer classify);
    @GetMapping("web/user/name")
    List<Integer> queryWebUsersByName(String name);

    @GetMapping("web/user/ids")
    List<WebUser> queryWebUsersByIds(List<Integer> userIds);

    @GetMapping("web/user/id")
    WebUser queryWebUserById(Long userId);
}

